<template>
  <div class="myCollect">
    <van-nav-bar
      :border="false"
      title="我的收藏"
      left-text="返回"
      left-arrow
      @click-left="$router.back()"
    />
    <AuthCollect
      v-for="item in postList"
      :key="item.id"
      :postData="item"
      @click.native="$router.push(`/postdetail?id=${item.id}`)"
    />
  </div>
</template>

<script>
export default {
  data() {
    return {
      postList: [],
    };
  },
  components: {
    AuthCollect: () => import("../../components/AuthCollect"),
  },
  created() {
    this.$axios({
      url: "/user_star",
      // url: "/post_star/4",
    }).then((res) => {
      console.log(res.data.data);
      this.postList = res.data.data;
    });
  },
};
</script>

<style lang="less" scoped>
.myCollect {
  background-color: papayawhip;
  .van-nav-bar {
    //组件背景颜色不设置
    background-color: unset;
  }
}
</style>